package cn.edu.nju.software.cdiy.dao;

import java.util.Date;
import java.util.GregorianCalendar;
import java.util.List;
import java.util.Map;

import org.hibernate.Session;

import cn.edu.nju.software.cdiy.bean.Horder;
import cn.edu.nju.software.cdiy.bean.Value;

public interface HorderDao {

	//Transtion
	public Horder save(Horder impl);
	
	public Horder updateHorderState(long horderId,Value state);
	public List loadBySupplierId(Long supplier);
	
	/*
	 * 找出在某个时间段之内，订单的状态为“订单待处理”的用户订单，然后解析出13个硬件的的HashMap中
	 * 然后转化为orderHardware
	 * 
	 */
	public Map<Integer,Horder> createHorderList(GregorianCalendar endDate,Session session);
	
	public List<Horder> loadSupplierHorder(int supplier,Value state,int page,int pageSize);
	
	public long getSupplierHorderLength(int supplier,Value state);
	
	public List<Horder> getSuplierHorderAll(int supplier,int page,int pageSize);
	public long getSuplierHorderAllLength(int supplier);
}
